package person.bing.fbcloud.common.log.event;

import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import person.bing.fbcloud.entity.SysLog;
import person.bing.fbcloud.service.UpmsService;

/**
 * @author: mengfanbing
 * @date: 2020/5/19 13:33
 */
@AllArgsConstructor
public class SysLogListener {
    private final UpmsService upmsService;

    @Async
    @Order
    @EventListener(SysLogEvent.class)
    public void saveSysLog(SysLogEvent event){
        SysLog sysLog = event.getSysLog();
        upmsService.saveSysLog(sysLog);
    }

}
